<template>
    <div class="card-components">
        <div class="card-wrapper">
            <div v-show="title" class="card-title">{{ title }}</div>
            <div class="card-desc" v-show="desc">{{ desc }}</div>
            <slot></slot>
        </div>
    </div>
</template>

<script setup>
const {title, desc} = defineProps({
    title: {
        type: String,
        default: '', // 标题
    },
    desc: {
        type: String,
        default: '', // 描述
    },
});
</script>

<style lang="css" scoped>
.card-components {
    .card-wrapper {
        min-width: 522px;
        color: #333;
        padding: 24px;
        border-radius: 6px;
        background: #fff;

        .card-title {
            height: 22px;
            font-size: 16px;
            font-weight: 600;
            color: #151b26;
            line-height: 22px;
        }

        .card-desc {
            margin-top: 16px;
            height: 22px;
            font-size: 14px;
            font-weight: 500;
            color: #151b26;
            line-height: 22px;
        }

        .card-list {
            .card-list-item {
                display: flex;
                flex: 1;
                align-items: center;
                margin-top: 12px;

                .card-list-item-title-wrapper {
                    display: flex;
                    align-items: center;
                    justify-content: space-between;

                    .idx {
                        width: 12px;
                        height: 12px;
                        padding: 2px;
                        border-radius: 50%;
                        display: flex;
                        justify-content: center;
                        align-items: center;
                        color: #fff;
                        font-size: 12px;
                        margin-right: 8px;
                    }

                    .card-list-item-title {
                        min-width: 50px;
                        max-width: 78px;
                        font-size: 14px;
                        font-weight: 500;
                        color: #151b26;
                        line-height: 22px;
                        height: 22px;
                    }
                }

                .gradual {
                    flex: 1;
                    margin: 0 8px 0 12px;

                    .gradual-base {
                        height: 12px;
                    }
                }

                .gradient-bg {
                    background: linear-gradient(270deg, #4aa1fa 0%, #2468f2 100%);
                }

                .card-list-item-unit {
                    height: 22px;
                    font-size: 14px;
                    font-weight: 400;
                    color: #151b26;
                    line-height: 22px;
                }
            }
        }

        .more {
            margin: 12px 0 0 24px;
            color: #2468f2;
            font-size: 14px;
            height: 22px;
            line-height: 22px;
        }
    }
}
</style>
